﻿@{
    Layout = "~/Views/Shared/_Submenu.cshtml";
}
@using SapaFinance.DTO
@using SapaFinance.UI.Controllers
@using Telerik.Web.Mvc.UI
@model IEnumerable<CurrencyDTO>
<h2>
    Список валют</h2>
<div>
    @(Html.Telerik().Grid(Model)
               .Name("Grid")
               .DataKeys(keys => { keys.Add(o => o.UID); })
               .Columns(columns =>
                        {
                            columns.Bound(o => o.UID).Hidden(true);
                            columns.Bound(o => o.Name);
                            columns.Bound(o => o.TypeName).Visible(true);
                            columns.Command(commands =>
                                            {
                                                commands.Edit();
                                            });
                        })
               .DataBinding(dataBinding => dataBinding.Server()
                                               .Select<CurrencyController>(x => x.Index())
                                                       .Insert("Insert", "Currency")
                                                               .Update("Update", "Currency")
                                                               .Delete("Delete", "Currency")
               )
               .Sortable(sorting => sorting.Enabled(true))
               .Selectable(x => x.Enabled(true))
               .Editable(x => x.Enabled(true).Mode(GridEditMode.PopUp))

        )
</div>
